﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebVideo.Models
{
    public class TinTucModel
    {
        public int Id { set; get; }
        public string Title { set; get; }
        public string Des { set; get; }
        public DateTime? Date { set; get; }
        public int? Viewed { set; get; }
        public string Image { set; get; }
        public string IdTypeNews { set; get; }
        public static TinTucModel LayModel(int IdNew)
        {
            TinTucModel tt = new TinTucModel();
            dbVideoDataContext db = new dbVideoDataContext();
            EntityNew tnew = db.EntityNews.Where(p => p.Id == IdNew).Single();

            tt.Title = tnew.Title;
            tt.Des = tnew.Des;
            tt.Date = tnew.Date;
      
            return tt;

        }
    }
}